﻿using UnityEngine;
using System.Collections;
using strange.extensions.dispatcher.eventdispatcher.api;
using strange.extensions.mediation.impl;

public class CubeMediator :  Mediator
{
    [Inject]
    public CubeView cubeview { get; set; }

    [Inject]
    public IEventDispatcher dispatcher { get; set; }

    public override void OnRegister()
    {
        //对象注册时调用,一般是初始化功能
        cubeview.Init();

        //通过dispatcher发起请求命令
        dispatcher.Dispatch(Demo1CommandEvent.RequestScore);

        Debug.Log("注册对象");
    }

    public override void OnRemove()
    {
        //对象关闭时调用
    }
}
